/*************************************************************************
	> File Name: abuse_of_longjmp.c
	> Author: Angel Criss
	> Blog: blog.abbycin.tk 
	> Created Time: Sat 26 Jul 2014 10:57:27 AM CST
 ************************************************************************/

#include<stdio.h>
#include<setjmp.h>

static jmp_buf env;

int add(c,d)
{
    setjmp(env);

    return c+d;
}

void jmp()
{
    printf("now jmp\n");

    longjmp(env,add());
}

int main(int argc,char *argv[])
{
    int a=1;
    int b=2;
    int c;

    c=add(a,b);
    jmp();

    return;
}
